<%-- 
    Document   : createUser
    Created on : 10/10/2011, 12:55:23 AM
    Author     : s4206222
--%>
<style>
    #changeform {         
        padding-bottom:20px;
        padding-top:20px;
        padding-left:70px;
        font-family: Verdana,Arial;
    }   
    #button{
        padding-left: 373px;        
    }
    #info{
        padding-left: 30px;
        padding-top: 20px;
        padding-bottom: 20px;
        font-size:10px;
        text-align: left;
        font-family:Verdana,Arial;
    }

    .error { color: red; font-weight: bold; }
</style>
<%@ include file="header.jsp" %>

<div id="content-container">
    <div id="content">
        <!-- Content goes here -->
        <form:form method="post" commandName="createUser">

            <label>UserName</label> <form:input path="userName"/> <form:errors path="userName" cssClass="error"/></br>  
            <label>Email</label> <form:input path="email"/>  <form:errors path="email" cssClass="error"/></br>  
            <label>User Type</label>  <form:select path="type" onchange="typeChange()" id = "select">
                <form:option value="0" label="Select" />
                <%
                    if (tempType != null) {
                        for (String type : types) {

                            if (type.equals(userType)) {
                                if (!userType.equals("SysAdmin")) {
                                    break;
                                }
                            }%>
                            <form:option value="<%=type%>" label="<%=type%>"/>
                        <%}
                    }
                %>
            </form:select>
            <form:errors path="type" cssClass="error"/></br>  
            <span id="exp" hidden="true"><label>Expiry Date</label><form:input path="expire" id = "expire"/><label>MM/DD/ YYYY</label> <form:errors path="expire" cssClass="error"/></br></span>
            <input type="submit" align="center" value="Execute">
        </form:form>
    </div>
</div>		
<script language="Javascript">
    if (document.getElementById("expire").value != ""){
        document.getElementById("exp").hidden=false;
    }
    function typeChange(){
        type =document.getElementById("select").value;        
        if (type=="Admin"){
            document.getElementById("exp").hidden=false;
        }
    }
    
</script>
<%@ include file="footer.jsp" %>
